<template>
	<view class="content">
		<view class="selectClass">
			<view>角块缓冲</view>
			<uni-data-select :localdata="cornerRange" v-model="bufferIndex_C" @change="changeC();" :clear="false"></uni-data-select>
		</view>
		<view class="selectClass">
			<view>棱块缓冲</view>
			<uni-data-select :localdata="edgeRange" v-model="bufferIndex_E" @change="changeE();":clear="false"></uni-data-select>
		</view>
		<view class="selectClass">
			<view>坐标调整</view>
			<uni-data-select :localdata="coordinateRange" v-model="coordinate" @change="changeCoordinate();":clear="false"></uni-data-select>
		</view>
	</view>
</template>

<script>
	import constant from '../../utils/constant';
	import storage from "../../utils/storage";
	export default {
		
		data() {
			return {
				cornerRange: [
				        { value: 0, text: "UBR" },
				        { value: 1, text: "UFR" },
						{ value: 2, text: "UFL" },
						{ value: 3, text: "UBL" },
						{ value: 4, text: "DBR" },
						{ value: 5, text: "DFR" },
						{ value: 6, text: "DFL" },
						{ value: 7, text: "DBL" }
				      ],
				bufferIndex_C:1,
				edgeRange: [
				        { value: 0, text: "UB" },
				        { value: 1, text: "UR" },
						{ value: 2, text: "UF" },
						{ value: 3, text: "UL" },
						{ value: 5, text: "BR" },
						{ value: 7, text: "FR" },
						{ value: 9, text: "FL" },
						{ value: 11, text: "BL" },
						{ value: 13, text: "DB" },
						{ value: 14, text: "DR" },
						{ value: 15, text: "DF" },
						{ value: 16, text: "DL" },
				      ],
				bufferIndex_E:2,
				coordinate:0,
				coordinateRange: [
				        { value: 0, text: "黄顶红前" },
				        { value: 1, text: "黄顶蓝前" },
						{ value: 2, text: "黄顶橙前" },
						{ value: 3, text: "黄顶绿前" },
						{ value: 4, text: "白顶绿前" },
						{ value: 5, text: "白顶橙前" },
						{ value: 6, text: "白顶蓝前" },
						{ value: 7, text: "白顶红前" },
						{ value: 8, text: "绿顶红前" },
						{ value: 9, text: "绿顶黄前" },
						{ value: 10, text: "绿顶橙前" },
						{ value: 11, text: "绿顶白前" },
						{ value: 12, text: "蓝顶红前" },
						{ value: 13, text: "蓝顶白前" },
						{ value: 14, text: "蓝顶橙前" },
						{ value: 15, text: "蓝顶黄前" },
						{ value: 16, text: "红顶绿前" },
						{ value: 17, text: "红顶白前" },
						{ value: 18, text: "红顶蓝前" },
						{ value: 19, text: "红顶黄前" },
						{ value: 20, text: "橙顶黄前" },
						{ value: 21, text: "橙顶蓝前" },
						{ value: 22, text: "橙顶白前" },
						{ value: 23, text: "橙顶绿前" },
				      ]
			}
		},
		onLoad() {
			this.bufferIndex_C = constant.getBufferIndex_C();
			this.bufferIndex_E = constant.getBufferIndex_E();
			this.coordinate = constant.getCoordinate();
		},
		methods: {
			changeCoordinate(){
				storage.setStorageSync('coordinate',this.coordinate);
				uni.$emit('update');
			},
			changeC(){
				storage.setStorageSync('bufferIndex_C',this.bufferIndex_C);
				uni.$emit('update');
				
			},
			changeE(){
				storage.setStorageSync('bufferIndex_E',this.bufferIndex_E);
				uni.$emit('update');
			}
			
		}
	}
</script>

<style lang="scss">
	.content {
		display: flex;
		flex-direction: column;
		align-items: left;
		justify-content: center;
	}

	.selectClass {
		margin: 10rpx;
		display: flex;
		flex-direction: row;
		align-items: center;
	}
	
	
	
</style>
